.class public Lcom/melesta/payment/PaymentTransaction;
.super Ljava/lang/Object;
.source "PaymentTransaction.java"


# static fields
.field private static final serialVersionUID:I = 0x1


# instance fields
.field public consumeTime:J

.field public customData:Ljava/lang/String;

.field public internalId:J

.field public paymentId:Ljava/lang/String;

.field public paymentSystem:Ljava/lang/String;

.field public processingTime:J

.field public quantity:I

.field public time:J


# direct methods
.method public constructor <init>()V
    .locals 3

    .prologue
    const-wide/16 v1, -0x1

    .line 17
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 22
    const/4 v0, -0x1

    iput v0, p0, Lcom/melesta/payment/PaymentTransaction;->quantity:I

    .line 26
    iput-wide v1, p0, Lcom/melesta/payment/PaymentTransaction;->time:J

    .line 30
    iput-wide v1, p0, Lcom/melesta/payment/PaymentTransaction;->processingTime:J

    .line 34
    iput-wide v1, p0, Lcom/melesta/payment/PaymentTransaction;->consumeTime:J

    .line 35
    iput-wide v1, p0, Lcom/melesta/payment/PaymentTransaction;->internalId:J

    return-void
.end method

.method public static convertTime(J)Ljava/lang/String;
    .locals 5
    .parameter "time"

    .prologue
    .line 145
    :try_start_0
    new-instance v0, Ljava/util/Date;

    invoke-direct {v0, p0, p1}, Ljava/util/Date;-><init>(J)V

    .line 146
    .local v0, date:Ljava/util/Date;
    new-instance v2, Ljava/text/SimpleDateFormat;

    const-string v3, "yyyy.MM.dd HH:mm:ss"

    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v4

    invoke-direct {v2, v3, v4}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;Ljava/util/Locale;)V

    .line 147
    .local v2, format:Ljava/text/Format;
    invoke-virtual {v2, v0}, Ljava/text/Format;->format(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/String;->toString()Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v3

    .line 149
    .end local v0           #date:Ljava/util/Date;
    .end local v2           #format:Ljava/text/Format;
    :goto_0
    return-object v3

    .line 148
    :catch_0
    move-exception v1

    .line 149
    .local v1, e:Ljava/lang/Exception;
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "invalid-"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p0, p1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    goto :goto_0
.end method

.method public static deserialize([B)Lcom/melesta/payment/PaymentTransaction;
    .locals 7
    .parameter "data"

    .prologue
    .line 76
    new-instance v3, Lcom/melesta/payment/PaymentTransaction;

    invoke-direct {v3}, Lcom/melesta/payment/PaymentTransaction;-><init>()V

    .line 78
    .local v3, res:Lcom/melesta/payment/PaymentTransaction;
    new-instance v0, Ljava/io/ByteArrayInputStream;

    invoke-direct {v0, p0}, Ljava/io/ByteArrayInputStream;-><init>([B)V

    .line 79
    .local v0, bos:Ljava/io/ByteArrayInputStream;
    new-instance v2, Ljava/io/DataInputStream;

    invoke-direct {v2, v0}, Ljava/io/DataInputStream;-><init>(Ljava/io/InputStream;)V

    .line 83
    .local v2, reader:Ljava/io/DataInputStream;
    :try_start_0
    invoke-virtual {v2}, Ljava/io/DataInputStream;->readInt()I

    move-result v4

    .line 85
    .local v4, version:I
    invoke-virtual {v2}, Ljava/io/DataInputStream;->readUTF()Ljava/lang/String;

    move-result-object v5

    iput-object v5, v3, Lcom/melesta/payment/PaymentTransaction;->paymentId:Ljava/lang/String;

    .line 86
    invoke-virtual {v2}, Ljava/io/DataInputStream;->readUTF()Ljava/lang/String;

    move-result-object v5

    iput-object v5, v3, Lcom/melesta/payment/PaymentTransaction;->paymentSystem:Ljava/lang/String;

    .line 87
    invoke-virtual {v2}, Ljava/io/DataInputStream;->readInt()I

    move-result v5

    iput v5, v3, Lcom/melesta/payment/PaymentTransaction;->quantity:I

    .line 88
    invoke-virtual {v2}, Ljava/io/DataInputStream;->readLong()J

    move-result-wide v5

    iput-wide v5, v3, Lcom/melesta/payment/PaymentTransaction;->time:J

    .line 89
    invoke-virtual {v2}, Ljava/io/DataInputStream;->readLong()J

    move-result-wide v5

    iput-wide v5, v3, Lcom/melesta/payment/PaymentTransaction;->processingTime:J

    .line 90
    invoke-virtual {v2}, Ljava/io/DataInputStream;->readLong()J

    move-result-wide v5

    iput-wide v5, v3, Lcom/melesta/payment/PaymentTransaction;->consumeTime:J

    .line 91
    invoke-virtual {v2}, Ljava/io/DataInputStream;->readLong()J

    move-result-wide v5

    iput-wide v5, v3, Lcom/melesta/payment/PaymentTransaction;->internalId:J

    .line 92
    invoke-virtual {v2}, Ljava/io/DataInputStream;->readUTF()Ljava/lang/String;

    move-result-object v5

    iput-object v5, v3, Lcom/melesta/payment/PaymentTransaction;->customData:Ljava/lang/String;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 97
    :try_start_1
    invoke-virtual {v2}, Ljava/io/DataInputStream;->close()V

    .line 98
    invoke-virtual {v0}, Ljava/io/ByteArrayInputStream;->close()V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_3

    .line 103
    .end local v4           #version:I
    :goto_0
    iget v5, v3, Lcom/melesta/payment/PaymentTransaction;->quantity:I

    const/4 v6, -0x1

    if-ne v5, v6, :cond_0

    const/4 v3, 0x0

    .end local v3           #res:Lcom/melesta/payment/PaymentTransaction;
    :cond_0
    return-object v3

    .line 93
    .restart local v3       #res:Lcom/melesta/payment/PaymentTransaction;
    :catch_0
    move-exception v1

    .line 94
    .local v1, e:Ljava/io/IOException;
    :try_start_2
    invoke-static {v1}, Lcom/melesta/engine/Error;->processException(Ljava/lang/Exception;)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 97
    :try_start_3
    invoke-virtual {v2}, Ljava/io/DataInputStream;->close()V

    .line 98
    invoke-virtual {v0}, Ljava/io/ByteArrayInputStream;->close()V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_1

    goto :goto_0

    .line 99
    :catch_1
    move-exception v5

    goto :goto_0

    .line 96
    .end local v1           #e:Ljava/io/IOException;
    :catchall_0
    move-exception v5

    .line 97
    :try_start_4
    invoke-virtual {v2}, Ljava/io/DataInputStream;->close()V

    .line 98
    invoke-virtual {v0}, Ljava/io/ByteArrayInputStream;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_2

    .line 100
    :goto_1
    throw v5

    .line 99
    :catch_2
    move-exception v6

    goto :goto_1

    .restart local v4       #version:I
    :catch_3
    move-exception v5

    goto :goto_0
.end method

.method public static dump(Lcom/melesta/payment/PaymentTransaction;)V
    .locals 3
    .parameter "t"

    .prologue
    .line 122
    new-instance v0, Ljava/lang/StringBuilder;

    const/16 v1, 0x80

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(I)V

    .line 123
    .local v0, sb:Ljava/lang/StringBuilder;
    invoke-static {p0, v0}, Lcom/melesta/payment/PaymentTransaction;->dump(Lcom/melesta/payment/PaymentTransaction;Ljava/lang/StringBuilder;)V

    .line 124
    const-string v1, "engine"

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 125
    return-void
.end method

.method public static dump(Lcom/melesta/payment/PaymentTransaction;Ljava/lang/StringBuilder;)V
    .locals 3
    .parameter "t"
    .parameter "out"

    .prologue
    .line 134
    const-string v0, "iId: "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v1, p0, Lcom/melesta/payment/PaymentTransaction;->internalId:J

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    .line 135
    const-string v0, "   id: "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lcom/melesta/payment/PaymentTransaction;->paymentId:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 136
    const-string v0, "   sys: "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lcom/melesta/payment/PaymentTransaction;->paymentSystem:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 137
    const-string v0, "   time: "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v1, p0, Lcom/melesta/payment/PaymentTransaction;->time:J

    invoke-static {v1, v2}, Lcom/melesta/payment/PaymentTransaction;->convertTime(J)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 138
    const-string v0, "   pTime: "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v1, p0, Lcom/melesta/payment/PaymentTransaction;->processingTime:J

    invoke-static {v1, v2}, Lcom/melesta/payment/PaymentTransaction;->convertTime(J)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 139
    const-string v0, "   cTime: "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v1, p0, Lcom/melesta/payment/PaymentTransaction;->consumeTime:J

    invoke-static {v1, v2}, Lcom/melesta/payment/PaymentTransaction;->convertTime(J)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 140
    const-string v0, "   udata: "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lcom/melesta/payment/PaymentTransaction;->customData:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 141
    return-void
.end method

.method public static dump(Ljava/util/List;)V
    .locals 3
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/melesta/payment/PaymentTransaction;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 116
    .local p0, lst:Ljava/util/List;,"Ljava/util/List<Lcom/melesta/payment/PaymentTransaction;>;"
    invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/melesta/payment/PaymentTransaction;

    .line 117
    .local v1, t:Lcom/melesta/payment/PaymentTransaction;
    invoke-static {v1}, Lcom/melesta/payment/PaymentTransaction;->dump(Lcom/melesta/payment/PaymentTransaction;)V

    goto :goto_0

    .line 119
    .end local v1           #t:Lcom/melesta/payment/PaymentTransaction;
    :cond_0
    return-void
.end method

.method public static dump(Ljava/util/List;Ljava/lang/StringBuilder;)V
    .locals 3
    .parameter
    .parameter "out"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/melesta/payment/PaymentTransaction;",
            ">;",
            "Ljava/lang/StringBuilder;",
            ")V"
        }
    .end annotation

    .prologue
    .line 128
    .local p0, lst:Ljava/util/List;,"Ljava/util/List<Lcom/melesta/payment/PaymentTransaction;>;"
    invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/melesta/payment/PaymentTransaction;

    .line 129
    .local v1, t:Lcom/melesta/payment/PaymentTransaction;
    invoke-static {v1, p1}, Lcom/melesta/payment/PaymentTransaction;->dump(Lcom/melesta/payment/PaymentTransaction;Ljava/lang/StringBuilder;)V

    goto :goto_0

    .line 131
    .end local v1           #t:Lcom/melesta/payment/PaymentTransaction;
    :cond_0
    return-void
.end method

.method public static isInList(Ljava/util/List;Ljava/lang/String;)Lcom/melesta/payment/PaymentTransaction;
    .locals 3
    .parameter
    .parameter "id"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/melesta/payment/PaymentTransaction;",
            ">;",
            "Ljava/lang/String;",
            ")",
            "Lcom/melesta/payment/PaymentTransaction;"
        }
    .end annotation

    .prologue
    .line 107
    .local p0, lst:Ljava/util/List;,"Ljava/util/List<Lcom/melesta/payment/PaymentTransaction;>;"
    invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :cond_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/melesta/payment/PaymentTransaction;

    .line 108
    .local v1, t:Lcom/melesta/payment/PaymentTransaction;
    iget-object v2, v1, Lcom/melesta/payment/PaymentTransaction;->paymentId:Ljava/lang/String;

    invoke-virtual {v2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 112
    .end local v1           #t:Lcom/melesta/payment/PaymentTransaction;
    :goto_0
    return-object v1

    :cond_1
    const/4 v1, 0x0

    goto :goto_0
.end method


# virtual methods
.method public serialize()[B
    .locals 6

    .prologue
    .line 39
    iget-object v4, p0, Lcom/melesta/payment/PaymentTransaction;->paymentId:Ljava/lang/String;

    if-nez v4, :cond_0

    .line 40
    const-string v4, ""

    iput-object v4, p0, Lcom/melesta/payment/PaymentTransaction;->paymentId:Ljava/lang/String;

    .line 43
    :cond_0
    iget-object v4, p0, Lcom/melesta/payment/PaymentTransaction;->customData:Ljava/lang/String;

    if-nez v4, :cond_1

    .line 44
    const-string v4, ""

    iput-object v4, p0, Lcom/melesta/payment/PaymentTransaction;->customData:Ljava/lang/String;

    .line 47
    :cond_1
    iget-object v4, p0, Lcom/melesta/payment/PaymentTransaction;->paymentId:Ljava/lang/String;

    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v4

    add-int/lit8 v4, v4, 0x4

    add-int/lit8 v4, v4, 0x4

    add-int/lit8 v4, v4, 0x8

    add-int/lit8 v4, v4, 0x8

    add-int/lit8 v4, v4, 0x4

    iget-object v5, p0, Lcom/melesta/payment/PaymentTransaction;->customData:Ljava/lang/String;

    invoke-virtual {v5}, Ljava/lang/String;->length()I

    move-result v5

    add-int v2, v4, v5

    .line 49
    .local v2, len:I
    new-instance v0, Ljava/io/ByteArrayOutputStream;

    add-int/lit8 v4, v2, 0x20

    invoke-direct {v0, v4}, Ljava/io/ByteArrayOutputStream;-><init>(I)V

    .line 50
    .local v0, bos:Ljava/io/ByteArrayOutputStream;
    new-instance v3, Ljava/io/DataOutputStream;

    invoke-direct {v3, v0}, Ljava/io/DataOutputStream;-><init>(Ljava/io/OutputStream;)V

    .line 52
    .local v3, outWriter:Ljava/io/DataOutputStream;
    const/4 v4, 0x1

    :try_start_0
    invoke-virtual {v3, v4}, Ljava/io/DataOutputStream;->writeInt(I)V

    .line 53
    iget-object v4, p0, Lcom/melesta/payment/PaymentTransaction;->paymentId:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/io/DataOutputStream;->writeUTF(Ljava/lang/String;)V

    .line 54
    iget-object v4, p0, Lcom/melesta/payment/PaymentTransaction;->paymentSystem:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/io/DataOutputStream;->writeUTF(Ljava/lang/String;)V

    .line 55
    iget v4, p0, Lcom/melesta/payment/PaymentTransaction;->quantity:I

    invoke-virtual {v3, v4}, Ljava/io/DataOutputStream;->writeInt(I)V

    .line 56
    iget-wide v4, p0, Lcom/melesta/payment/PaymentTransaction;->time:J

    invoke-virtual {v3, v4, v5}, Ljava/io/DataOutputStream;->writeLong(J)V

    .line 57
    iget-wide v4, p0, Lcom/melesta/payment/PaymentTransaction;->processingTime:J

    invoke-virtual {v3, v4, v5}, Ljava/io/DataOutputStream;->writeLong(J)V

    .line 58
    iget-wide v4, p0, Lcom/melesta/payment/PaymentTransaction;->consumeTime:J

    invoke-virtual {v3, v4, v5}, Ljava/io/DataOutputStream;->writeLong(J)V

    .line 59
    iget-wide v4, p0, Lcom/melesta/payment/PaymentTransaction;->internalId:J

    invoke-virtual {v3, v4, v5}, Ljava/io/DataOutputStream;->writeLong(J)V

    .line 60
    iget-object v4, p0, Lcom/melesta/payment/PaymentTransaction;->customData:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/io/DataOutputStream;->writeUTF(Ljava/lang/String;)V

    .line 61
    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v4

    .line 66
    :try_start_1
    invoke-virtual {v3}, Ljava/io/DataOutputStream;->close()V

    .line 67
    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_3

    .line 72
    :goto_0
    return-object v4

    .line 62
    :catch_0
    move-exception v1

    .line 63
    .local v1, e:Ljava/io/IOException;
    :try_start_2
    invoke-static {v1}, Lcom/melesta/engine/Error;->processException(Ljava/lang/Exception;)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 66
    :try_start_3
    invoke-virtual {v3}, Ljava/io/DataOutputStream;->close()V

    .line 67
    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_2

    .line 72
    :goto_1
    const/4 v4, 0x0

    goto :goto_0

    .line 65
    .end local v1           #e:Ljava/io/IOException;
    :catchall_0
    move-exception v4

    .line 66
    :try_start_4
    invoke-virtual {v3}, Ljava/io/DataOutputStream;->close()V

    .line 67
    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_1

    .line 69
    :goto_2
    throw v4

    .line 68
    :catch_1
    move-exception v5

    goto :goto_2

    .restart local v1       #e:Ljava/io/IOException;
    :catch_2
    move-exception v4

    goto :goto_1

    .end local v1           #e:Ljava/io/IOException;
    :catch_3
    move-exception v5

    goto :goto_0
.end method
